﻿using INTEX.DataBase.Tools;
using ReflectionStudio.Components.UserControls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OracleClient;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;

namespace WPFExcelReport
{
    public partial class ViewBase
    {
        #region ==FTAUTOSUM===========
        public static readonly DependencyProperty FTAUTOSUMProperty = DependencyProperty.Register("FTAUTOSUM",
            typeof(bool), typeof(ViewBase),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnFTAUTOSUMChanged));
        public bool FTAUTOSUM
        {
            get
            {
                return (bool)GetValue(FTAUTOSUMProperty);
            }
            set
            {
                SetValue(FTAUTOSUMProperty, value);
                if (MV == null) return;
                MV.FTAUTOSUM = value;
            }
        }
        private static void OnFTAUTOSUMChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.FTAUTOSUM = (bool)e.NewValue;
            }
        }
        #endregion
        #region ==Pages===========
        public static readonly DependencyProperty PagesProperty = DependencyProperty.Register("Pages",
            typeof(int), typeof(ViewBase),
            new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnPagesChanged));
        public int Pages
        {
            get
            {
                return (int)GetValue(PagesProperty);
            }
            set
            {
                SetValue(PagesProperty, value);
                if (MV == null) return;
                MV.Pages = value;
            }
        }
        private static void OnPagesChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.Pages = (int)e.NewValue;
            }
        }
        #endregion

        #region ==PageNow===========
        public static readonly DependencyProperty PageNowProperty = DependencyProperty.Register("PageNow",
            typeof(int), typeof(ViewBase),
            new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnPageNowChanged));
        public int PageNow
        {
            get
            {
                return (int)GetValue(PageNowProperty);
            }
            set
            {
                SetValue(PageNowProperty, value);
                if (MV == null) return;
                MV.PageNow = value;
            }
        }
        private static void OnPageNowChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.PageNow = (int)e.NewValue;
            }
        }
        #endregion

        #region ==Counts===========

        public int Counts
        {
            get
            {
                return MV.Counts;
            }
            set
            {
                if (MV == null) return;
                MV.Counts = value;
            }
        }

        #endregion

        #region ==Rows===========
        public static readonly DependencyProperty RowsProperty = DependencyProperty.Register("Rows",
            typeof(int), typeof(ViewBase),
            new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnRowsChanged));
        public int Rows
        {
            get
            {
                return (int)GetValue(RowsProperty);
            }
            set
            {
                SetValue(RowsProperty, value);
                if (MV == null) return;
                MV.Rows = value;
            }
        }
        private static void OnRowsChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.Rows = (int)e.NewValue;
            }
        }
        #endregion


        #region ==KEY1===========
        public static readonly DependencyProperty KEY1Property = DependencyProperty.Register("KEY1",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnKEY1Changed));
        public string KEY1
        {
            get
            {
                return (string)GetValue(KEY1Property);
            }
            set
            {
                SetValue(KEY1Property, value);
                if (MV == null) return;
                MV.KEY1 = value;
            }
        }
        private static void OnKEY1Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.KEY1 = (string)e.NewValue;
            }
        }
        #endregion
        #region ==SUM1===========
        public static readonly DependencyProperty SUM1Property = DependencyProperty.Register("SUM1",
            typeof(double), typeof(ViewBase),
            new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSUM1Changed));
        public double SUM1
        {
            get
            {
                return (double)GetValue(SUM1Property);
            }
            set
            {
                SetValue(SUM1Property, value);
                if (MV == null) return;
                MV.SUM1 = value;
            }
        }
        private static void OnSUM1Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.SUM1 = (double)e.NewValue;
            }
        }
        #endregion
        #region ==TKEY1===========
        public static readonly DependencyProperty TKEY1Property = DependencyProperty.Register("TKEY1",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTKEY1Changed));
        public string TKEY1
        {
            get
            {
                return (string)GetValue(TKEY1Property);
            }
            set
            {
                SetValue(TKEY1Property, value);
                if (MV == null) return;
                MV.TKEY1 = value;
            }
        }
        private static void OnTKEY1Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.TKEY1 = (string)e.NewValue;
            }
        }
        #endregion
        #region ==SKEY1===========
        public static readonly DependencyProperty SKEY1Property = DependencyProperty.Register("SKEY1",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSKEY1Changed));
        public string SKEY1
        {
            get
            {
                return (string)GetValue(SKEY1Property);
            }
            set
            {
                SetValue(SKEY1Property, value);
                if (MV == null) return;
                MV.SKEY1 = value;
            }
        }
        private static void OnSKEY1Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.SKEY1 = (string)e.NewValue;
            }
        }
        #endregion
        #region ==Counts1===========
        public static readonly DependencyProperty Counts1Property = DependencyProperty.Register("Counts1",
            typeof(int), typeof(ViewBase),
            new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnCounts1Changed));
        public int Counts1
        {
            get
            {
                return (int)GetValue(Counts1Property);
            }
            set
            {
                SetValue(Counts1Property, value);
                if (MV == null) return;
                MV.Counts1 = value;
            }
        }
        private static void OnCounts1Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.Counts1 = (int)e.NewValue;
            }
        }
        #endregion
        #region ==TCOUNT1===========
        public static readonly DependencyProperty TCOUNT1Property = DependencyProperty.Register("TCOUNT1",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTCOUNT1Changed));
        public string TCOUNT1
        {
            get
            {
                return (string)GetValue(TCOUNT1Property);
            }
            set
            {
                SetValue(TCOUNT1Property, value);
                if (MV == null) return;
                MV.TCOUNT1 = value;
            }
        }
        private static void OnTCOUNT1Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.TCOUNT1 = (string)e.NewValue;
            }
        }
        #endregion


        #region ==KEY2===========
        public static readonly DependencyProperty KEY2Property = DependencyProperty.Register("KEY2",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnKEY2Changed));
        public string KEY2
        {
            get
            {
                return (string)GetValue(KEY2Property);
            }
            set
            {
                SetValue(KEY2Property, value);
                if (MV == null) return;
                MV.KEY2 = value;
            }
        }
        private static void OnKEY2Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.KEY2 = (string)e.NewValue;
            }
        }
        #endregion
        #region ==SUM2===========
        public static readonly DependencyProperty SUM2Property = DependencyProperty.Register("SUM2",
            typeof(double), typeof(ViewBase),
            new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSUM2Changed));
        public double SUM2
        {
            get
            {
                return (double)GetValue(SUM2Property);
            }
            set
            {
                SetValue(SUM2Property, value);
                if (MV == null) return;
                MV.SUM2 = value;
            }
        }
        private static void OnSUM2Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.SUM2 = (double)e.NewValue;
            }
        }
        #endregion
        #region ==Counts2===========
        public static readonly DependencyProperty Counts2Property = DependencyProperty.Register("Counts2",
            typeof(int), typeof(ViewBase),
            new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnCounts2Changed));
        public int Counts2
        {
            get
            {
                return (int)GetValue(Counts2Property);
            }
            set
            {
                SetValue(Counts2Property, value);
                if (MV == null) return;
                MV.Counts2 = value;
            }
        }
        private static void OnCounts2Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.Counts2 = (int)e.NewValue;
            }
        }
        #endregion
        #region ==TKEY2===========
        public static readonly DependencyProperty TKEY2Property = DependencyProperty.Register("TKEY2",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTKEY2Changed));
        public string TKEY2
        {
            get
            {
                return (string)GetValue(TKEY2Property);
            }
            set
            {
                SetValue(TKEY2Property, value);
                if (MV == null) return;
                MV.TKEY2 = value;
            }
        }
        private static void OnTKEY2Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.TKEY2 = (string)e.NewValue;
            }
        }
        #endregion
        #region ==TCOUNT2===========
        public static readonly DependencyProperty TCOUNT2Property = DependencyProperty.Register("TCOUNT2",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTCOUNT2Changed));
        public string TCOUNT2
        {
            get
            {
                return (string)GetValue(TCOUNT2Property);
            }
            set
            {
                SetValue(TCOUNT2Property, value);
                if (MV == null) return;
                MV.TCOUNT2 = value;
            }
        }
        private static void OnTCOUNT2Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.TCOUNT2 = (string)e.NewValue;
            }
        }
        #endregion

        #region ==SKEY2===========
        public static readonly DependencyProperty SKEY2Property = DependencyProperty.Register("SKEY2",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSKEY2Changed));
        public string SKEY2
        {
            get
            {
                return (string)GetValue(SKEY2Property);
            }
            set
            {
                SetValue(SKEY2Property, value);
                if (MV == null) return;
                MV.SKEY2 = value;
            }
        }
        private static void OnSKEY2Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.SKEY2 = (string)e.NewValue;
            }
        }
        #endregion

        #region ==Set===========
        public static readonly DependencyProperty SetProperty = DependencyProperty.Register("Set",
            typeof(DataSet), typeof(ViewBase),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSetChanged));
        public DataSet Set
        {
            get
            {
                return (DataSet)GetValue(SetProperty);
            }
            set
            {
                SetValue(SetProperty, value);
                if (MV == null) return;
                MV.Set = value;
            }
        }
        private static void OnSetChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.Set = (DataSet)e.NewValue;
            }
        }
        #endregion



        #region ==KEY3===========
        public static readonly DependencyProperty KEY3Property = DependencyProperty.Register("KEY3",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnKEY3Changed));
        public string KEY3
        {
            get
            {
                return (string)GetValue(KEY3Property);
            }
            set
            {
                SetValue(KEY3Property, value);
                if (MV == null) return;
                MV.KEY3 = value;
            }
        }
        private static void OnKEY3Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.KEY3 = (string)e.NewValue;
            }
        }
        #endregion
        #region ==SUM3===========
        public static readonly DependencyProperty SUM3Property = DependencyProperty.Register("SUM3",
            typeof(double), typeof(ViewBase),
            new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSUM3Changed));
        public double SUM3
        {
            get
            {
                return (double)GetValue(SUM3Property);
            }
            set
            {
                SetValue(SUM3Property, value);
                if (MV == null) return;
                MV.SUM3 = value;
            }
        }
        private static void OnSUM3Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.SUM3 = (double)e.NewValue;
            }
        }
        #endregion
        #region ==TKEY3===========
        public static readonly DependencyProperty TKEY3Property = DependencyProperty.Register("TKEY3",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTKEY3Changed));
        public string TKEY3
        {
            get
            {
                return (string)GetValue(TKEY3Property);
            }
            set
            {
                SetValue(TKEY3Property, value);
                if (MV == null) return;
                MV.TKEY3 = value;
            }
        }
        private static void OnTKEY3Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.TKEY3 = (string)e.NewValue;
            }
        }
        #endregion
        #region ==SKEY3===========
        public static readonly DependencyProperty SKEY3Property = DependencyProperty.Register("SKEY3",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSKEY3Changed));
        public string SKEY3
        {
            get
            {
                return (string)GetValue(SKEY3Property);
            }
            set
            {
                SetValue(SKEY3Property, value);
                if (MV == null) return;
                MV.SKEY3 = value;
            }
        }
        private static void OnSKEY3Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.SKEY3 = (string)e.NewValue;
            }
        }
        #endregion
        #region ==Counts3===========
        public static readonly DependencyProperty Counts3Property = DependencyProperty.Register("Counts3",
            typeof(int), typeof(ViewBase),
            new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnCounts3Changed));
        public int Counts3
        {
            get
            {
                return (int)GetValue(Counts3Property);
            }
            set
            {
                SetValue(Counts3Property, value);
                if (MV == null) return;
                MV.Counts3 = value;
            }
        }
        private static void OnCounts3Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.Counts3 = (int)e.NewValue;
            }
        }
        #endregion
        #region ==TCOUNT3===========
        public static readonly DependencyProperty TCOUNT3Property = DependencyProperty.Register("TCOUNT3",
            typeof(string), typeof(ViewBase),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTCOUNT3Changed));
        public string TCOUNT3
        {
            get
            {
                return (string)GetValue(TCOUNT3Property);
            }
            set
            {
                SetValue(TCOUNT3Property, value);
                if (MV == null) return;
                MV.TCOUNT3 = value;
            }
        }
        private static void OnTCOUNT3Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as ViewBase;
            if (src != null)
            {
                src.TCOUNT3 = (string)e.NewValue;
            }
        }
        #endregion
    }
}
